<template>
    <div>
        <Modal
                v-model="modal1"
                title="修改详情"

        >
            <Row>
                <Col span="12">申报项目名称:<Input v-model="datas.proname" placeholder="" style="width: 100px" /></Col>
                <Col span="12">标题:<Input v-model="datas.title" placeholder="" style="width: 100px ;margin-left: 25px" /></Col>
            </Row>
            <br>
            <Row>
                <!--<Col span="8">col-8</Col>
                <Col span="8">col-8</Col>
                <Col span="8">col-8</Col>-->
                <Col span="12">内容:<Input v-model="datas.new" placeholder="" style="width: 100px;margin-left: 45px" /></Col>
                <Col span="12">评分专家:<Input v-model="datas.pingfenpel" placeholder="" style="width: 100px" /></Col>
            </Row>
            <br>
            <Row>

                <Col span="12">分数:<Input v-model="datas.num" placeholder="" style="width: 100px;margin-left: 45px" /></Col>
                <Col span="12">状态:<Input v-model="datas.statu" placeholder="" style="width: 100px;margin-left: 25px" /></Col>
            </Row>
        </Modal>

        <Table border :columns="columns7" :data="data6"></Table>
        <Page :total="4" show-total  STYLE="text-align: right"/>
    </div>
</template>

<script>
export default {
  data () {
    return {
      modal1: false,
      datas: [],
      columns7: [
        {
          title: '申报项目名称',
          key: 'proname'

        },
        {
          title: '标题',
          key: 'title'
        },
        {
          title: '内容',
          key: 'new'
        }, {
          title: '评分专家',
          key: 'pingfenpel'
        }, {
          title: '分数',
          key: 'num'
        },
        {
          title: '状态',
          key: 'statu'
        },
        {
          title: '操作',
          key: 'action',
          width: 220,
          align: 'center',
          render: (h, params) => {
            return h('div', [

              h('Button', {
                props: {
                  type: 'error',
                  size: 'small'
                },
                style: {
                  marginRight: '5px',
                  display: params.row.statu === '发布' ? 'inline' : 'none'
                },
                on: {
                  click: () => {
                    this.change(params.row)
                  }
                }
              }, '退回'),

              h('Button', {
                props: {
                  type: 'success',
                  size: 'small'
                },
                style: {
                  marginRight: '5px',
                  display: params.row.statu === '未发布' ? 'inline' : 'none'
                },
                on: {
                  click: () => {
                    this.changefabu(params.row)
                  }
                }
              }, '发布'),
              h('Button', {
                props: {
                  type: 'warning',
                  size: 'small'
                },
                style: {
                  marginRight: '5px',
                  display: params.row.statu === '未发布' ? 'inline' : 'none'
                },
                on: {
                  click: () => {
                    this.show(params.row)
                  }
                }
              }, '修改'),
              h('Button', {
                props: {
                  type: 'primary',
                  size: 'small'
                },
                on: {
                  click: () => {

                  }
                }
              }, '打印')
            ])
          }
        }
      ],
      data6: [
        {
          proname: '守护生命，救在身边',
          title: 18,
          new: '守护生命，救在身边创新项目',
          pingfenpel: '张明',
          num: '30',
          statu: '发布'
        },
        {
          proname: '社会治理与社会创新',
          title: 26,
          new: '社会治理与社会创新应用',
          pingfenpel: '陈东',
          num: '44',
          statu: '发布'

        },
        {
          proname: '论技术',
          title: 24,
          new: '论技术创新的应用性',
          pingfenpel: '肖平',
          num: '33',
          statu: '未发布'
        },
        {
          proname: '复杂产品系统创新',
          title: 30,
          new: '复杂产品系统创新',
          pingfenpel: '李楠',
          num: '56',
          statu: '未发布'
        }
      ]
    }
  },
  methods: {
    show (params) {
      /* this.$Modal.info({
        title: 'User Info',
        content: `Name：${this.data6[index].name}<br>Age：${this.data6[index].age}<br>Address：${this.data6[index].address}`
      }) */
      console.log(params)
      this.modal1 = true
      this.datas = params
      console.log(this.datas)
    },
    change (parma) {
      console.log(parma)
      let index = parma._index
      console.log(index)

      console.log(this.data6[index].statu)
      this.data6[index].statu = '未发布'
    },
    changefabu (parma) {
      console.log(parma)
      let index = parma._index
      console.log(index)

      console.log(this.data6[index].statu)
      this.data6[index].statu = '发布'
    }

  } }
</script>

<style scoped>

</style>
